package com.wuyanzu.shixicoderedo.common.threadlocal;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 请求上下文：保存 correlationId + patientId 等
 */
public class RequestContext implements Serializable {

    private static final long serialVersionUID = 1L;

    // 链路追踪 ID
    private final String correlationId;

    // 患者/业务 ID
    private final String patientId;

    // 请求共享数据
    private final Map<String, Object> shared = new ConcurrentHashMap<>();

    public RequestContext(String correlationId, String patientId) {
        this.correlationId = correlationId;
        this.patientId = patientId;
    }

    public String getCorrelationId() { return correlationId; }
    public String getPatientId() { return patientId; }
    public Map<String, Object> getShared() { return shared; }
}
